using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Raster._RasterProperties
{
    /// <summary>
    /// <para>Batch Calculate Statistics</para>
    /// <para>Calculates statistics for  multiple raster datasets.</para>
    /// <para>计算多个栅格数据集的统计数据。</para>
    /// </summary>    
    [DisplayName("Batch Calculate Statistics")]
    public class BatchCalculateStatistics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public BatchCalculateStatistics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_Input_Raster_Datasets">
        /// <para>Input Raster Datasets</para>
        /// <para>The input raster datasets.</para>
        /// <para>输入栅格数据集。</para>
        /// </param>
        public BatchCalculateStatistics(List<object> _Input_Raster_Datasets)
        {
            this._Input_Raster_Datasets = _Input_Raster_Datasets;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Batch Calculate Statistics";

        public override string CallName => "management.BatchCalculateStatistics";

        public override List<string> AcceptEnvironments => ["rasterStatistics", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_Input_Raster_Datasets, _Number_of_columns_to_skip, _Number_of_rows_to_skip, _Ignore_values, _Skip_Existing.GetGPValue(), _Batch_Calculate_Statistics_Succeeded];

        /// <summary>
        /// <para>Input Raster Datasets</para>
        /// <para>The input raster datasets.</para>
        /// <para>输入栅格数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Raster Datasets")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _Input_Raster_Datasets { get; set; }


        /// <summary>
        /// <para>X Skip Factor</para>
        /// <para><xdoc>
        ///   <para>The number of horizontal pixels between samples.</para>
        ///   <para>A skip factor controls the portion of the raster that is used when calculating the statistics. The input value indicates the horizontal or vertical skip factor, where a value of 1 will use each pixel and a value of 2 will use every second pixel. The skip factor can only range from 1 to the number of columns/rows in the raster.</para>
        ///   <para>The value must be greater than zero and less than or equal to the number of columns in the raster. The default is 1 or the last skip factor used.</para>
        ///   <para>The skip factors for raster datasets stored in a file geodatabase or an enterprise geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level, and those statistics are used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>样本之间的水平像素数。</para>
        ///   <para>跳跃因子用于控制计算统计数据时使用的栅格部分。输入值指示水平或垂直跳跃因子，其中值 1 将使用每个像素，值 2 将使用每第二个像素。跳跃因子的范围只能从 1 到栅格中的列/行数。</para>
        ///   <para>该值必须大于零且小于或等于栅格中的列数。默认值为 1 或使用的最后一个跳过因子。</para>
        ///   <para>存储在文件地理数据库或企业级地理数据库中的栅格数据集的跳跃系数不同。首先，如果 x 和 y 跳跃因子不同，则较小的跳跃因子将用于 x 和 y 跳跃因子。其次，跳跃因子与最接近所选跳跃因子的金字塔水平有关。如果跳跃因子值不等于金字塔图层中的像素数，则该数字将向下舍入到下一个金字塔级别，并使用这些统计数据。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("X Skip Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _Number_of_columns_to_skip { get; set; } = 1;


        /// <summary>
        /// <para>Y Skip Factor</para>
        /// <para><xdoc>
        ///   <para>The number of vertical pixels between samples.</para>
        ///   <para>A skip factor controls the portion of the raster that is used when calculating the statistics. The input value indicates the horizontal or vertical skip factor, where a value of 1 will use each pixel and a value of 2 will use every second pixel. The skip factor can only range from 1 to the number of columns/rows in the raster.</para>
        ///   <para>The value must be greater than zero and less than or equal to the number of rows in the raster. The default is 1 or the last y skip factor used.</para>
        ///   <para>The skip factors for raster datasets stored in a file geodatabase or an enterprise geodatabase are different. First, if the x and y skip factors are different, the smaller skip factor will be used for both the x and y skip factors. Second, the skip factor is related to the pyramid level that most closely fits the skip factor chosen. If the skip factor value is not equal to the number of pixels in a pyramid layer, the number is rounded down to the next pyramid level, and those statistics are used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>样本之间的垂直像素数。</para>
        ///   <para>跳跃因子用于控制计算统计数据时使用的栅格部分。输入值指示水平或垂直跳跃因子，其中值 1 将使用每个像素，值 2 将使用每第二个像素。跳跃因子的范围只能从 1 到栅格中的列/行数。</para>
        ///   <para>该值必须大于零且小于或等于栅格中的行数。默认值为 1 或使用的最后一个 y 跳过因子。</para>
        ///   <para>存储在文件地理数据库或企业级地理数据库中的栅格数据集的跳跃系数不同。首先，如果 x 和 y 跳跃因子不同，则较小的跳跃因子将用于 x 和 y 跳跃因子。其次，跳跃因子与最接近所选跳跃因子的金字塔水平有关。如果跳跃因子值不等于金字塔图层中的像素数，则该数字将向下舍入到下一个金字塔级别，并使用这些统计数据。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Y Skip Factor")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _Number_of_rows_to_skip { get; set; } = 1;


        /// <summary>
        /// <para>Ignore values</para>
        /// <para><xdoc>
        ///   <para>The pixel values that are not to be included in the statistics calculation.</para>
        ///   <para>The default is no value.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>统计信息计算中不包括的像素值。</para>
        ///   <para>默认值为 no value。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore values")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _Ignore_values { get; set; } = null;


        /// <summary>
        /// <para>Skip Existing</para>
        /// <para><xdoc>
        ///   <para>Specify whether to calculate statistics only where they are missing or regenerate them even if they exist.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Statistics will be calculated even if they already exist; therefore, existing statistics will be overwritten. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Statistics will only be calculated if they do not already exist.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是仅在缺少统计数据时计算统计数据，还是重新生成统计数据（即使它们存在）。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 即使统计数据已存在，也会计算统计数据;因此，现有统计信息将被覆盖。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 仅当统计数据尚不存在时，才会计算统计数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Skip Existing")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _Skip_Existing_value? _Skip_Existing { get; set; } = null;

        public enum _Skip_Existing_value
        {
            /// <summary>
            /// <para>OVERWRITE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OVERWRITE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>SKIP_EXISTING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SKIP_EXISTING")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Batch Calculate Statistics Succeeded</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Batch Calculate Statistics Succeeded")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _Batch_Calculate_Statistics_Succeeded { get; set; }


        public BatchCalculateStatistics SetEnv(object rasterStatistics = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(rasterStatistics: rasterStatistics, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}